package huizhi.net;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 * 获取connection连接对象
 */
public class ConnectionRequest {
    public static Connection requestConnection() throws ClassNotFoundException, SQLException {
        //注册驱动
        Class.forName("com.mysql.cj.jdbc.Driver");
        //获取连接
        String url = "jdbc:mysql://127.0.0.1:3306/flowertest3";
        String username = "root";
        String password = "Lin58936543@";
        return DriverManager.getConnection(url,username,password);

    }
}
